<?php

class m130808_122951_create_table_credits extends CDbMigration
{
	public function up()
	{
		$this->createTable('{{credits}}',array(
			'id' => 'pk',
			'client_id' => 'INT(11) NOT NULL',
			'user_id' => 'INT(11) NOT NULL',
			'shop_id' => 'INT(11) NOT NULL',
			'sum' => 'FLOAT(9.2) NOT NULL',
			'product_name' => 'VARCHAR(250) NOT NULL',
			'receipt_date' => 'DATETIME DEFAULT NULL',
			'duration' => 'INT(4) NOT NULL',
			'close_date' => 'DATETIME NULL DEFAULT NULL',
			'created_at' => 'DATETIME NOT NULL',
			'updated_at' => 'TIMESTAMP NOT NULL',
			'scorring_ball' => 'FLOAT(5,2) NULL DEFAULT NULL',
			'status' => 'INT(1) DEFAULT NULL'
		));
	}

	public function down()
	{
		$this->dropTable('{{credits}}');
	}
}